//
//  ITSettingModel.m
//  ITBE
//
//  Created by ITBE on 2019/10/15.
//  Copyright © 2019 ITBE. All rights reserved.
//

#import "ITSettingModel.h"
#import "ITAppStartManager.h"
@implementation ITSettingModel


+ (instancetype)modelWithType:(ITSettingType)type{
    ITSettingModel *model = [ITSettingModel new];
    model.type = type;
    model.place = [AppUtils titleForKey:@"Perfecting Information"];
    //Member *host = [[ITAppStartManager shareManager] currentMember];
    ITUserInfo *host = ITUserManager.currentMember;
    switch (type) {
        case ITSettingTypeADTest:{
            model.title = [AppUtils titleForKey:@"AD Test"];
            model.icon = @"more_report";
        }
            break;
        case ITSettingTypeBlock:{
            model.title = [AppUtils titleForKey:@"Block user"];
            model.icon = @"more_blacklist";
        }
            break;
        case ITSettingTypeDislike:{
            model.title = [AppUtils titleForKey:@"Dislike"];
            model.icon = @"more_dislike";
        }
            break;
        case ITSettingTypeVideoShare:{
            model.title = [AppUtils titleForKey:@"Share"];
            model.icon = @"more_share";
        }
            break;
        case ITSettingTypeReport:{
            model.title = [AppUtils titleForKey:@"Report"];
            model.icon = @"more_report";
        }
            break;
        case ITSettingTypeSpeed:{
            model.title = [AppUtils titleForKey:@"Playback speed"];
            model.icon = @"more_speed";
        }
            break;
        case ITSettingTypeCancel:{
            model.title = [AppUtils titleForKey:@"Cancel"];
            model.icon = @"more_close";
        }
            break;
        case ITSettingTypeSetting:{
            model.title = [AppUtils titleForKey:@"Set up"];
            model.icon = @"setting_icon";
        }
            break;
        case ITSettingTypePrivacy:{
            model.title = [AppUtils titleForKey:@"Privacy"];
        }
            break;
            
        case ITSettingTypeAgreement:{
            model.title = [AppUtils titleForKey:@"Service agreement"];
        }
            break;
        case ITSettingTypeAbout:{
            model.title = [AppUtils titleForKey:@"About us"];
        }
            break;
        case ITSettingTypeDailyNotification:{
            model.title = [AppUtils titleForKey:@"Daily notification"];
        }
            break;
        case ITSettingTypeSettingProfile:{
            model.title = [AppUtils titleForKey:@"User Profile"];
        }
            break;
        case ITSettingTypePortrait:{
            model.title = [AppUtils titleForKey:@"Head Portrait"];
            model.key = @"portrait";
        }
            break;
                
        case ITSettingTypeUserName:{
            model.title = [AppUtils titleForKey:@"Name"];
            model.key = @"name";
        }
            break;
                    
        case ITSettingTypeID:{
            model.title = [AppUtils titleForKey:@"ID"];
            model.key = @"memberId";
        }
            break;
            
        case ITSettingTypeGender:{
            model.title = [AppUtils titleForKey:@"Gender"];
            model.key = @"gender";
        }
            break;
        case ITSettingTypeSignature:{
            model.title = [AppUtils titleForKey:@"Profile"];
            model.place = [AppUtils titleForKey:@"Fill in profile…"];
            model.key = @"signature";
        }
            break;
        case ITSettingTypePhoneNumber:{
            model.title = [AppUtils titleForKey:@"Phone\nNumber"];
            model.key = @"mobile";
        }
            break;

        case ITSettingTypeUserSource:{
            if ([host.source isEqualToString:@"app"]) {
                model.title = [AppUtils titleForKey:@"Phone\nNumber"];
                model.key = @"mobile";
            }else {
                model.title = [AppUtils titleForKey:@"From"];
                model.key = @"source";
            }
        }
            break;
        case ITSettingTypeInvitation:{
            model.title = [AppUtils titleForKey:@"Invitation Code"];
            model.key = @"inviterCode";
        }
            break;
        case ITSettingTypeVersion:{
            model.title = [AppUtils titleForKey:@"App Version"];
            model.subTitle = [ITDeviceInfo appVersion];
        }
            break;
        case ITSettingTypeFacebook:{
                
            model.title = [AppUtils titleForKey:@"Facebook"];
        }
            break;
        case ITSettingTypeFeedback:{
            
            model.title = [AppUtils titleForKey:@"Help&Feedback"];
            model.subTitle = @" ";
            model.icon = @"setting_feedback";
        }
            break;
        case ITSettingTypeClearCache:{
            
            model.title = [AppUtils titleForKey:@"Clear Cache"];
        }
            break;
        case ITSettingTypeLanguage:{
            
            model.title = [AppUtils titleForKey:@"App Language"];
        }
            break;
        case ITSettingTypeFavorites:{
            
            model.title = [AppUtils titleForKey:@"Favorites"];
            model.icon = @"setting_favorites";
        }
            break;
        case ITSettingTypeProfile:{
            
            model.title = [AppUtils titleForKey:@"Profile"];
            model.icon = @"setting_profile";
            model.place = [AppUtils titleForKey:@"Fill in profile…"];
        }
            break;
        case ITSettingTypeShare:{
                
            model.title = [AppUtils titleForKey:@"My share"];
            model.icon = @"setting_share";
        }
            break;
        case ITSettingTypeLogout:{
                
            model.title = [AppUtils titleForKey:@"Exit"];
        }
            break;
        default:
            break;
    }
    return model;
}

@end
